<template>
  <div class="denglu">
    <h1>登陆</h1>
    <!--input输入框-->
    <el-input v-model="input" placeholder="请输入账号" style="width: 600px;height:50px"></el-input>
    <br>
    <!--input输入框-->
    <el-input placeholder="请输入密码" v-model="input2" show-password style="width: 600px;height:50px"></el-input>
    <br>
    <!--登陆-->
    <button v-on:click="gget">登陆</button>
  </div>
</template>

<script>
export default {
  name: "Denglu",
  created() {},
  data() {
    return {
      input: '',
      input2: '',
      
    };
  },
  props: {},
  methods: {
    gget: function(){
      var that = this;
      this.$axios.post("/Login/login",{
        email : this.input,
        password : this.input2,
      })
      .then(function (response) {
          console.log("response!" + JSON.stringify(response));
          if(response.data.code == "0000"){
            sessionStorage.setItem("key", "11111")//拦截器登陆
            console.log("----登陆成功----")
            that.$router.push('/yemian');//跳转页面
            that.$message('登陆成功');
          }else if(response.data.code == "2222"){
            console.log("----登陆失败----")
          }
        })
        .catch(function (error) { });
    }
  },
};
</script>

<style lang="scss" scoped>

</style>